﻿@model Jb.Web.ViewModels.UtilityModels.ListConfig
@using Jb.Web.Utility;
@using Jb.Common.DB;

@{    
	String pageTitle = "List of Interview Requests";
    ViewBag.Title = Html.GetPageTitle(pageTitle);
    ViewData[AppConstants.ViewDataKeys.SELECTED_MENU] = JobSeekerMenu.InterviewRequests;
	//String editUrlFormat = Url.JobSeekerUrl("Edit", "InterviewRequest") + "/{0}";
}
<div class="jb-page-heading">
    <h1>@pageTitle</h1>
    <div>
        Check your interview requests from list below.
    </div>
</div>
<div class="jb-page-content">
    @if (Model.DataSource.Rows.Count > 0)
    {
        for (int i = 0; i < Model.DataSource.Rows.Count; i++)
        {
            System.Data.DataRow _Row = Model.DataSource.Rows[i];
            int _ApplicationID = NullHandler.GetInt(_Row["ApplicationID"]);
        <div class="jb-job">
            <div>
                <h2><small>Job Title: <a href="@(Url.JobDetailsUrl(NullHandler.GetInt(_Row["JobID"]), NullHandler.GetString(_Row["JobUrl"])))" target="_blank">@(_Row["JobTitle"])</a></small></h2>                
            </div>
            
            <div class="jb-label-hint">
                <a href="/@(_Row["CompanyUrl"])">@(_Row["CompanyName"])</a><br />
                Interview Request Sent On, @(NullHandler.GetDateTime(_Row["InvitedOn"]).ToString(AppConstants.ValueOf.DATE_FROMAT_DISPLAY_WITH_TIME))
            </div>
            
            
            <div class="para">
                Interview Date: @(NullHandler.GetDateTime(_Row["InvitationDate"]).ToString(AppConstants.ValueOf.DATE_FROMAT_DISPLAY_WITH_TIME))
                <br />
                <b>Message from the Employer:</b><br />
                @Html.Raw(WebUtil.FormatData(_Row["Message"]))
            </div>
            <div>                
                <a class="btn btn-mini" href="javascript:void(0);" onclick="ShowApplication(@(_ApplicationID));"><i class="icon-envelope"></i> Check your Application</a>
            </div>
            <div id="divCoverLetter_@(_ApplicationID)" class="hidden">@Html.Raw(Html.FormatData(NullHandler.GetString(_Row["CoverLetter"])))</div>
        </div>
        }
    }
    else
    {
        @Html.InfoMessageBox("Sorry! You haven't received any interview request, yet.")
    }
</div>

@*Modal Popup (Job Application) Section Starts*@
<div id="divCoverLetterDialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="divPhotoEditModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button>
        <h4 id="myModalLabel">Job Application</h4>
    </div>
    <div class="modal-body jb-inline-label">            
        <div id="divModalMesssage"></div>
    </div>
    <div class="modal-footer">        
        <button class="btn" data-dismiss="modal" aria-hidden="true"><i class="icon-off"></i> Close</button>
    </div>
</div>
@*Modal Popup (Job Application) Section Ends*@

@section PageHeadSection
{
<style type="text/css">
    .jb-job{padding-left:0px; padding-right:0px;}
</style>
}

@section JavaScriptPlaceHolder
{
<script language="javascript" type="text/javascript">
    function ShowApplication(applicationID) {
        var divID = 'divCoverLetter_' + applicationID;
        $('#divModalMesssage').html($('#' + divID).html());
        $('#divCoverLetterDialog').modal({ show: true });
    }
</script>
}